<% if @category %>
	<h1><%= link_to image_tag("feed.png", :align => "right"), "/categories/#{@category.id}/entries.rss" %> <%= @category.name %></h1>
<% end %>

<% unless @entries %>
	<% @entries = entries %>
<% end %>
<% for entry in @entries %>
  <div id="entry_<%= entry.id %>" class="entry">
	<%= render :partial => "/entries/entry_header", :locals => { :entry => entry } %>
	<div class="summary">
		<% if !entry.summary.to_s.empty? %>
			<%= textilize(entry.summary) %>
		<% else %>
			<%= textilize(entry.body) %>
		<% end %>
		<div class="nav_comments">
			<%= link_to "read", entry_path(entry) %> |
			<%= link_to "#{ pluralize(entry.comments.length, "comment") }", "#{entry_path(entry)}#comments" unless entry.comments.empty? %>
			<%= link_to image_tag("comments.png", :align => "absmiddle", :class => "icon"), "#{entry_path(entry)}#comments" unless entry.comments.empty? %>
			<%= "|" unless entry.comments.empty? %>
			<%= link_to "add a comment", "#{entry_path(entry)}#comment_form" %> 
			
			<%= link_to image_tag("comment_add.png", :align => "absmiddle", :class => "icon"), "#{entry_path(entry)}#comment_form" %>
		</div>
	</div>
  </div>
<% end %>

<% if logged_in? %>
	<p><%= link_to 'New entry', new_entry_path if current_user %></p>
<% end %>

